#!/bin/bash
# 停止集群并清理所有数据
echo "Clearing cluster data..."
docker-compose down

# 删除数据目录
rm -rf ./kafka-zookeeper/data
rm -rf ./kafka-node-1/data
rm -rf ./kafka-node-2/data
rm -rf ./kafka-node-3/data

# 重建空目录（可选）
mkdir -p ./kafka-zookeeper/data
mkdir -p ./kafka-node-1/data
mkdir -p ./kafka-node-2/data
mkdir -p ./kafka-node-3/data

echo "Data cleared successfully"
